import request from './request';

export async function doFetch({ url, params, type }: any) {
  return request(url, {
    method: type ? type : 'POST',
    data: params,
  });
}

export async function postFetch({ url, params }: any) {
  return request(url, {
    method: 'POST',
    data: params,
  });
}

export async function getFetch({ url, params }: any) {
  return request(url, {
    method: 'GET',
    data: params,
  });
}

export async function formFetch({ url, params }: any) {
  return request(url, {
    method: 'POST',
    data: params,
    type: 'form',
  });
}
